home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / umich / falcon / programm.ing / nt_dsp1.lzh / NT_DSP1.MSA / FNTNS / SQRT2T.ASM < prev    next >
Assembly Source File  |  1989-01-24  |  1KB  |  37 lines

  1. ;
  2. ; This program originally available on the Motorola DSP bulletin board.
  3. ; It is provided under a DISCLAMER OF WARRANTY available from
  4. ; Motorola DSP Operation, 6501 Wm. Cannon Drive W., Austin, Tx., 78735.
  5. ; Square Root by Polynomial Approximation, 10-bit Accuracy.
  6. ; (test program)
  7. ; Last Update 26 Jan 87   Version 1.0
  8. ;
  9.         opt     cex
  10.         page    132,66,0,0
  11.         nolist
  12.         include 'dsplib:ioequ'
  13.         list
  14.         include 'dsplib:sqrt2'
  15.  
  16. datin   equ     $ffff           ;location in y memory of input file
  17. datout  equ     $fffe           ;location in y memory of output file
  18.  
  19.         org     y:0
  20. pcoef   dc      .8803385,-.1985987,.3185231     ;a1,a2,a0
  21.  
  22.         org     p:$100
  23. start
  24.         movep   #0,x:M_BCR      ;no wait states on external io
  25. ;
  26.         do      #100,_e         ;number of points to do
  27.         move    #pcoef,r1       ;point to poly coef
  28.         movep   y:datin,x0      ;get input value
  29. ;
  30.         sqrt2                   ;do square root
  31. ;
  32.         movep   a,y:datout
  33. _e
  34.         end
  35.